#include <iostream>
#include "cute.h"
#include "ide_listener.h"
#include "cute_runner.h"
#include "ShellSort.h"
#include "ShellSortTestSuite.h"
using namespace std;

bool checkIfSorted(vector<int>& arr) {
	bool sorted = true;
	if (arr.size() > 1) {
		for (vector<int>::size_type i = 0; i < arr.size(); ++i) {
			//cout<<arr[i]<<",";
			if(arr[i] > arr[i+1]){
				sorted = false;
			}
		}
	}
	//cout<<endl;
	return sorted;
}

void thisIsAShellSortTestSuiteTest() {
	int tempa[] = {4, 1, 3, 10, 7, 21, 85, 64, 32, 28, 212, 17, 55, 12 };
	vector<int> arr(tempa, tempa + sizeof(tempa)/sizeof(*tempa));
	ShellSort sort;
	sort(arr);
	ASSERTM("start sort test", checkIfSorted(arr));
}

void make_suite_ShellSortTestSuite(){
	cute::suite s;
	s.push_back(CUTE(thisIsAShellSortTestSuiteTest));
	cute::ide_listener lis;
	cute::makeRunner(lis)(s, "The Suite");
	//return s;
}


